package org.jpro.exception;

import lombok.Getter;
import lombok.ToString;

/**
 * <P>功能描述 : 错误码 </P>
 * <P>File name : ExceptionCode </P>
 * <P>Author : 王泽浩 </P>
 * <P>E-Mail : 1028625100@qq.com </P>
 * <P>Date : 2017/1/1 上午12:22</P>
 */
@Getter
@ToString
public enum ExceptionCode {

    FAILED (-1, "系统错误"),
    /**
     * (0-99)通用系统级
     */
    SUCCESS (0, "成功"),
    TOLOGIN (1, "您还没有登录，请登录"),
    DATA_ERR (2, "数据异常"),

    /**
     * (99-9999)通用业务级
     */
    SIGN_ERR (88, "签名错误!"),
    HTTP_ERR (99, "服务器繁忙,请稍后再试!"),
    PARAM_ERROR (100, "参数异常"),
    ILLEGAL_REQUEST (101, "非法请求！"),
    JSON_ERROR (102, "JSON解析异常"),
    JSON_NODE_ERROR (103, "JSON节点解析异常"),
    HTTP_ERROR (104, "HTTP请求错误"),
    INVALID_REQUEST (105, "无效请求(参数缺失或非法调用)"),
    CONFIG_ERROR (106, "配置信息异常"),
    INPUT_TOO_LONG (107, "您输入的内容长度超过规定范围"),
    EMOJI_ERROR (108, "请勿输入特殊字符"),
    INVALID_CONTENT_LENGTH (109, "请输入符合长度规范的内容");

    /**
     * 异常代码
     */
    private final int code;

    /**
     * 异常消息
     */
    private final String msg;

    ExceptionCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
